package com.erb.mapper;


import com.erb.entity.Invest;
import org.apache.ibatis.annotations.Param;

import java.sql.Timestamp;
import java.util.List;
import java.util.Map;

public interface InvestMapper {
	int addInvest(Invest invest);

	List<Invest> findByStatus(int status);

	List<Invest> findByPid(int pid);

	int updateStatus(@Param("id") int id, @Param("status") int status);

	int batchUpdateStatus(@Param("oldStatus") int oldStatus, @Param("newStatus") int newStatus);

	int updateLastProfitDate(@Param("id") int id, @Param("lastProfitDate") Timestamp lastProfitDate);

	Double countInvestMoney();

	int sumUsersByProType(int type);

	int sumInvest();

	//int countInvestByMoney(@Param("pid") int pid, @Param("minMoney") Integer minMoney, @Param("maxMoney") Integer maxMoney);
	List<Map> countInvestByMoney(int pid);

	List<Map> countInvestBySex(int pid);

	int updateStatusByPid(@Param("pid") int pid, @Param("status") int status);
}
